package com.basic.bio.thread;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.Socket;
import java.util.Scanner;

/**
 * @Description:
 * @Date: 2024-03-28 11:07
 * @Author: wz
 **/
public class Client {

    public static void main(String[] args){
        try {
            Socket socket = new Socket("127.0.0.1", 9090);
            OutputStream os = socket.getOutputStream();

            PrintStream ps = new PrintStream(os);
            Scanner scanner = new Scanner(System.in);
            while (true){
                String msg = scanner.next();
                ps.println(msg);
                ps.flush();
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
